//
//  OPMembersCache.h
//  OPFramework
//
//  Created by malcom on 7/17/08.
//  Copyright 2008 malcom-mac software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OPUser.h"
#import "OPPageContainer.h"

@interface OPMembersCache : OPBaseObject {
	// PROPERTIES
	NSMutableArray		*p_onlineUsers;
	int					 p_onlineGuests;
	OPPageContainer		*p_paginatedList;
	
	// INTERNAL
	NSMutableDictionary *obj_cacheItems;
}

#pragma mark WORKING WITH CACHE
- (OPUser *) getUserMemberFromID:(NSNumber *) _id;
- (OPUser *) getUserMemberFromID:(NSNumber *) _id withName:(NSString *) _username;

- (void) addUserMember:(OPUser *) _user;
- (OPUser *) refreshUserCacheWithData:(NSDictionary *) _data;

#pragma mark WORKING WITH MEMBERS PAGINATED LIST
- (NSArray *) getMembersListPage:(NSNumber *) _pgIdx;

#pragma mark PUBLIC METHODS
- (NSArray *) getOnlineUsers;

#pragma mark PRIVATE METHODS
- (void) _parseOnlineUsersList:(NSArray *) _res;
- (NSArray *) _loadMembersListAtPage:(NSNumber *) _pageIdx;
- (id) initForBoard:(OPBoard *) _board;
- (void) _parseMembersListPageResults:(NSArray *) _results;

@end
